/*----------------------------------------------
| noka select v1.0 www.97521.com               |
| rebin 2014-01-15                             |
|---------------------------------------------*/
var nselect = Class.create({
    version: '1.0',
    initialize : function(cfg) {
    	this.cfg = cfg;					//配置信息
    	this.id=cfg.id; //id
    	this.name=cfg.name;//name
    	this.iwidth=cfg.width;//宽
    	this.value = cfg.value;
    	this.sdy = $(cfg.id+'_sDiv');
    	this.json = cfg.json;//初始值
    	this.height = cfg.height;//高度
    	this.sql = cfg.sql;
    	this.onchange = cfg.onchange;
    	this.value = cfg.value;
    	this.readonly = ('readonly'==cfg.readonly);
    	this.disabled = ('disabled'==cfg.disabled);
    	this.allownull = cfg.allownull;//为true表示可以为空
    	this.placeholder = cfg.placeholder;
    	this.msg = cfg.msg || '';
    	this.hImg;
    	this.mImg;
    	this.slang = cfg.slang;
    	this.lower = cfg.lower;
    	this.selectwidth = cfg.selectwidth;
    	this.optionwidth = cfg.optionwidth;
    	this.setvaluesun=0;//设置重试次数
    	this.topLower = (undefined==cfg.topLower?[]:cfg.topLower);//上级ID
    	this.findsql = cfg.findsql;//查找sql
    	this.nowHeight = cfg.height;//高度
    	this.findValue = '';//查找框的值
    	this.fjson = [];//查找数据
    	this.dataurl = (undefined == cfg.dataurl?cfg.rurl+'/nokatag/nselect'+this.id+'.select':cfg.dataurl);
    	this.findurl = (undefined == cfg.findurl?cfg.rurl+'/nokatag/nselect'+this.id+'.ajaxinput': cfg.findurl);
    },
    show : function(){
    	this.PreLoding();
    	this.initselect();
    	this.initFindInput();
    	this.initObjCht();
    },
    //-------------------初始化下拉框-------------------
    initselect : function(){
    	var idx = 0;
        var html = [];
        var self = this;
        var bodyHtml=$(self.id+'_selectDiv');
        self.iwidth-=18;
        //------------配置初始化--------------------------
        html[idx++] = '<div id="'+self.id+'_sidiv" class="select-dropdownchecklist nk_input_lineheight nk_input_sdDiv" style="width:'+self.iwidth+'px;float:left;">';
        html[idx++] = '<input id="'+self.id+'"   name="'+self.name+'" type="hidden" value="'+self.value+'">';
        html[idx++] = '<input id="'+self.id+'_sinput" placeholder="'+self.placeholder+'" type="text" class="nk_input_lineheight nk_select_input_text" style="width:'+self.iwidth+'px;" readonly="readonly" '+(self.disabled?'disabled="disabled"':'')+' value="">';
        html[idx++] = '</div>';
        if(!self.allownull){
        	html[idx++] = '<div style="float:left;color:red;" class="nk_input_imgheight">*</div>';
        	html[idx++] = '<div style="float:left;"><img style="display:none;vertical-align:middle" id="'+self.id+'_img" class="nk_input_imgheight" src="'+self.cfg.rurl+'/nokatag/formcheck/images/exclamation.gif"></img></div>';
        }
        bodyHtml.innerHTML=html.join('');
        //-----------加载事件-----------------------------
        var obj=$(self.cfg.id+'_sidiv');
        var tre=$(self.cfg.id+'_sboddiv');
        self.selectEvent(obj, tre);
        self.ExEvents();
        //-----------初始化内容---------------------------
        self.selectBody(tre);
    },
    //---------内容初始化-----------------------
    selectBody : function(obj){
    	var self = this;
    	if(''!=self.json){
    		self.jsonList();
    	}else if(''!=self.sql){
    		self.AjaxList();
    	}
    },
   //-------------please select---------------
    PleasSelect : function(json){
    	var self = this;
    	var vjson = [];
    	for(var i=0;i<json.length;i++){
    		vjson[i]=json[i];
    	}
    	if(self.allownull){//允许为空
    		vjson.unshift({text:self.slang,value:''});
    		return vjson;
    	}
    	if(!self.allownull && self.value.trim().length<1){//不允许为空
    		self.value=vjson[0].value;
    	}
    	return vjson;
    },
    //-------------初始化查询录入框------------------
    initFindInput : function(){
    	var self = this;
    	var idx = 0;
    	var html = [];
        var body=$(self.cfg.id+'_sboddiv');
        var Lwidth = self.iwidth+20;
        if(undefined!=self.findsql){
        	html[idx++] ='<div id="'+self.id+'_findinput">';
        	html[idx++] ='<div class="nk_input_lineheight nk_input_sdDiv" style="width:'+Lwidth+'px">';
        	html[idx++] ='<div style="float: left;"><input id="'+self.id+'_findInputtext" autocomplete="off" style="width:'+self.iwidth+'px" class="nk_input_lineheight nk_select_input_text" type="text"></div>';
        	html[idx++] ='<div style="float: right;"><input  style="width:0px;height:0px;border:1px solid #ffffff;margin-top:-20px"><div id="'+self.id+'_finedInputButton" class="selectbutton-dropdownchecklistx">&nbsp;</div></div>';
        	html[idx++] ='</div>';
        	html[idx++] ='<div style="clear: both;"></div>';
        	html[idx++] ='</div><div id="'+self.id+'_fselect_body" style="overflow:auto;height:40px;overflow-x:hidden;"></div>';
        	body.innerHTML=html.join('');
        }
        if(undefined!=self.findsql){
	    	$(self.id+'_finedInputButton').observe('click',function(a){
	         	self.FindAjaxList();
	        });
	    	$(self.id+'_findInputtext').observe('keydown',function(event){
	    		switch(event.keyCode){
			       case 38://上
			         self.selectItemKey(false);
			         break;
			       case 40://下
			    	   self.selectItemKey(true);
			         break;
			       case 13://回车键
			    	 $$('.select-list_hover').each(function(alink,index) {
			    		 if(alink.id.indexOf(self.id+'_')!=-1){
			    			 alink.click();
			    			 return;
			    		 }
		    		 });
			    	 break;
		        }
	    	});
	    	$(self.id+'_findInputtext').observe('keyup',function(event){
	    		if(self.findValue!=this.value){
	    			self.findValue = this.value;
	    			if(self.findValue.length<2){
	    				self.FindAjaxList();
	    			}else{
	    				self.findPageJson(self.findValue);
	    			}
	    		}
	    	});
    	}
    },
    //-------------页面查找-----------------------
    findPageJson : function(value){
    	var self = this;
    	var fjson = self.fjson;
    	var tjson = [];
    	var idx=0;
    	if(undefined!=fjson){
    		for(var i=0;i<fjson.length;i++){
    			if(fjson[i].text.indexOf(value)!=-1){
    				tjson[idx++] = fjson[i];
    			}
    		}
    	}
    	self.json = tjson;
    	self.jsonList();
    },
    //-------------选择选项-----------------------
    selectItemKey : function(down){//true 向下   false 向上
    	var self = this;
    	var selectid = self.id+'_'+(self.allownull?1:0);
    	$$('.select-list_hover').each(function(alink,index) {
    		if(alink.id.indexOf(self.id+'_')!=-1){
	    		selectid = alink.id;
				return;
    		}
		 });
    	var idx = selectid.substring(selectid.lastIndexOf('_')+1,selectid.length);
    	if(down){
    		idx++;
    	}else{
    		idx--;
    	}
    	var sitem = $(self.id+'_'+idx);
    	if(undefined!=sitem){
    		$$('.select-list_hover').each(function(alink,index) {
    			if(alink.id.indexOf(self.id+'_')!=-1){
    				alink.removeClassName('select-list_hover');
    			}
    		 });
    		sitem.addClassName('select-list_hover');
    		try{
    			$(self.id+'_fselect_body').scrollTop=sitem.positionedOffset().top-30;
    		}catch(e){}
    	}
    },
    //-------------json 值加载-------------------
    jsonList : function(){// [{id:sss,f},{value:dd}]
    	var self = this;
    	var idx = 0;
        var html = [];
        var body=$(self.cfg.id+'_sboddiv');
        var Lwidth = self.iwidth+20;
        var Lheight=0;
        var json=self.PleasSelect(self.json);
        var selectStyle = 'width:'+Lwidth+'px;';
        var isFindValue = false;//是否找到值
        if(self.selectwidth != undefined){//固定宽度
        	selectStyle = 'float: left;margin-right:5px;padding-right:3px;padding-left:3px;margin-bottom: 3px;border:1px solid #AFAFAF';
        }
        if(self.selectwidth != undefined && self.optionwidth != undefined){
        	selectStyle+=';width:'+self.optionwidth;
        }
        //-------------------------------------------------------------------------------
    	for(var i=0;i<json.length;i++){
    		html[idx++] = '<div id="'+self.id+'_'+i+'" class="select-list '+(((self.allownull && i==1) || (!self.allownull && i==0))?'select-list_hover':'')+'" style="'+selectStyle+'" title="'+json[i].text+'" alt="'+json[i].text+'">';
    		html[idx++] = json[i].text;
    		html[idx++] = '<input type="hidden" value="'+json[i].value+'" id="'+self.id+'_'+i+'_value">';
    		html[idx++] = '<input type="hidden" value="'+json[i].text+'"  id="'+self.id+'_'+i+'_text">';
    		if(json[i].vtype!=undefined){
    			html[idx++] = '<input type="hidden" value="'+json[i].vtype+'" id="'+self.id+'_'+i+'_vtype">';
    		}else{
    			html[idx++] = '<input type="hidden" value="-5" id="'+self.id+'_'+i+'_vtype">';
    		}
    		var nodestr = '';
            try{nodestr=Object.toJSON(json[i]);}catch(e){}
    		html[idx++] = '<div id="'+self.id+'_'+i+'_json"  style="display: none;">'+nodestr+'</div>';
    		html[idx++] = '</div>';
    		Lheight+=15;
    		if(self.value==json[i].value){
    			$(self.id).value=json[i].value;
    			$(self.id+'_sinput').value=json[i].text;
    			isFindValue=true;
    			//---------------------设置级联动作-----------------------------------
	            if(self.lower!=undefined && self.lower!='' && json[i].vtype!=undefined){
	            	$(self.lower).clearShowValue();
	            	var pares = (undefined == self.topLower?[]:self.topLower).clone();
	            	pares[pares.length]={pare:json[i].value,ftype:json[i].vtype};
    				$(self.lower).AjaxLoadData(pares);
    			}
    		}
    	}
    	if(!isFindValue && json.length>0){//没有找到
    		$(self.id).value=json[0].value;
			$(self.id+'_sinput').value=json[0].text;
			//---------------------设置级联动作-----------------------------------
            if(self.lower!=undefined && self.lower!='' && json[0].vtype!=undefined){
            	$(self.lower).clearShowValue();
            	var pares = (undefined == self.topLower?[]:self.topLower).clone();
            	pares[pares.length]={pare:json[0].value,ftype:json[0].vtype};
				$(self.lower).AjaxLoadData(pares);
			}
    	}
    	if(undefined!=self.findsql){
    		$(self.id+'_fselect_body').innerHTML=html.join('');
    	}else{
    		body.innerHTML=html.join('');
    	}
    	if(Lheight<=self.height){
    		body.setStyle({height:Lheight+'px'});
    		self.nowHeight=Lheight;
    	}else{
    		body.setStyle({height:self.height+'px'});
    		self.nowHeight=self.height;
    	}
    	body.setStyle({width:(Lwidth-1)+'px'});
    	if(self.selectwidth != undefined){//固定宽度
    		body.setStyle({width:self.selectwidth});
    	}
    	self.setHeigthFindBody();
    	self.setFindInputFous();
    	self.ListEvent(json);
    },
    //--------初始化验证-----------------
    initObjCht : function(){
    	var self = this;
    	$(self.id).veri = function(){
    	    if(($(self.id).value.trim().length<1) && !self.allownull){//不能为空
    	    	$(self.id+'_img').show();
    	    	return false;
    	    }
    	    try{$(self.id+'_img').hide();}catch(e){}
    	    return true;
    	};
    },
    //------------------reLoad------------------
    AjaxListSQL : function(pare){//[{pare:'',ftype:''}]
    	var self = this;
    	var idx = 0;//
    	var parsv=[];
    	var v = $(self.id).value;
    	parsv[idx++]=(''==self.sql?'':'&sql='+self.sql);
    	if(v.trim().length>0){
    		parsv[idx++]='&v='+v;
    	}
    	if(undefined!=self.findsql){
    		parsv[idx++]='&fsql='+self.findsql;
    	}
    	for(var i=0;i<pare.length;i++){
    		parsv[idx++]=(''==pare[i].pare?'':'&pare='+encodeURIComponent(pare[i].pare));
    		parsv[idx++]=(''==pare[i].ftype?'':'&vtype='+pare[i].ftype);
    	}
    	new Ajax.Request(self.dataurl, {
    		method:'post',
            parameters: parsv.join(''),
            onSuccess: function(response) {
            	var nodes = response.responseText.evalJSON();//json数据    [{value:'fddd',text:'fddf'},{value:'fddd',text:'fddf'}]
            	self.json = nodes;
            	self.clearShowValue();
            	self.jsonList();
            }
    	});
    },
    //------------------ajax方式加载值--------------
    AjaxList : function(){
    	var self = this;
    	var idx = 0;//
    	var parsv=[];
    	var v = $(self.id).value;
    	parsv[idx++]=(''==self.sql?'':'&sql='+self.sql);
    	if(v.trim().length>0){
    		parsv[idx++]='&v='+v;
    	}
    	if(undefined!=self.findsql){
    		parsv[idx++]='&fsql='+self.findsql;
    	}
    	if(undefined!=self.topLower && self.topLower.length>0){
    		var pare = self.topLower;
	    	for(var i=0;i<pare.length;i++){
	    		if(undefined!=pare[i].pare){
	    			parsv[idx++]=(''==pare[i].pare?'':'&pare='+encodeURIComponent(pare[i].pare));
	    			parsv[idx++]=(undefined==pare[i].ftype?'&vtype=-5':'&vtype='+pare[i].ftype);
	    		}
	    	}
    	}
    	//-------------------------------------------------------
    	if(undefined!=self.topLower){
    		for(var i=0;i<self.topLower.length;i++){
        		parsv[idx++]=(''==self.topLower[i].pare?'':'&lower='+encodeURIComponent(self.topLower[i].pare));
        		parsv[idx++]=(''==self.topLower[i].ftype?'':'&lowev='+self.topLower[i].ftype);
        	}
    	}
    	//---------------------------------------------------------
    	new Ajax.Request(self.dataurl, {
    		method:'post',
            parameters: parsv.join(''),
            onSuccess: function(response) {
            	var nodes = response.responseText.evalJSON();//json数据    [{value:'fddd',text:'fddf'},{value:'fddd',text:'fddf'}]
            	self.json = nodes;
            	self.clearShowValue();
            	self.jsonList();
            }
    	});
    },
    //-------------------查询方式加载----------------------------------------------------
    FindAjaxList : function(){
    	var self = this;
    	var idx = 0;//
    	var parsv=[];
    	var v = $(self.id).value;
    	var findValue = $(self.id+'_findInputtext').value;
    	if(findValue.trim().length>0){//有输入值
	    	parsv[idx++]=(''==self.findsql?'':'&sql='+self.findsql);
	    	if(v.trim().length>0){
	    		parsv[idx++]='&v='+v;
	    	}
	    	if(undefined!=self.findsql){
	    		parsv[idx++]='&fsql='+self.findsql;
	    	}
	    	//-------------------------------------------------------
	    	if(undefined!=self.topLower){
	    		for(var i=0;i<self.topLower.length;i++){
	        		parsv[idx++]=(''==self.topLower[i].pare?'':'&lower='+encodeURIComponent(self.topLower[i].pare));
	        		parsv[idx++]=(''==self.topLower[i].ftype?'':'&lowev='+self.topLower[i].ftype);
	        	}
	    	}
	    	//---------------------------------------------------------
	    	parsv[idx++]=(findValue.trim().length<1?'':'&pare='+encodeURIComponent(findValue.trim()));//查询参数
	    	new Ajax.Request(self.findurl, {
	    		method:'post',
	            parameters: parsv.join(''),
	            onSuccess: function(response) {
	            	var nodes = response.responseText.evalJSON();//json数据    [{value:'fddd',text:'fddf'},{value:'fddd',text:'fddf'}]
	            	self.json = nodes;
	            	self.jsonList();
	            	self.fjson = nodes;
	            }
	    	});
    	}else{
    		self.AjaxList();
    	}
    },
    //------------------列表单击事件----------------
    ListEvent : function(json){
    	var self = this;
    	var textObj = $(self.id+'_sinput');
        var valueObj =$(self.id);
    	for(var i=0;i<json.length;i++){
    		$(self.id+'_'+i).observe('click',function(a){
    			var v=$(this.id+'_value').value;
    			var t=$(this.id+'_text').value;
    			var vt=$(this.id+'_vtype').value;
    			self.value = v;
    			var nod = $(this.id+'_json').innerHTML.evalJSON();
    			nod.id = self.id;
    			nod.name = self.name;
    			if(self.onchange(nod)){
	    			textObj.value = t;
	    			valueObj.value = v;
	    			if(self.lower!=undefined && self.lower!=''){
	    				$(self.lower).clearShowValue();
	    				var pares = (undefined == self.topLower?[]:self.topLower).clone();
		            	pares[pares.length]={pare:v,ftype:vt};
	    				$(self.lower).AjaxLoadData(pares);
	    			}
    			}
    			try{$(self.id+'_img').hide();}catch(e){}
    			self.setFindInputFous();
    			$(self.cfg.id+'_sboddiv').hide();
            });
    		$(self.id+'_'+i).observe('mousemove',function(a){
    			this.setStyle({color:'#ffffff',backgroundColor:'#000080'});
            });
    		$(self.id+'_'+i).observe('mouseout',function(a){
    			this.setStyle({color:'#000000',backgroundColor:'#ffffff'});
            });
    	}
    },
    //----------------清空显示值和实际值----------------
    clearShowValue : function(){
    	var self = this;
    	$(self.id+'_sinput').value='';
        $(self.id).value='';
    },
    //----------------外部事件---------------------
    ExEvents : function(){
    	var self = this;
    	var textObj = $(self.id+'_sinput');
        var valueObj =$(self.id);
    	//------------刷新sql数据------------------
    	$(self.id).Reload = function(){
    		self.AjaxList();
    	};
    	//------------设置值------------------
    	$(self.id).setValue = function(v,t){
    		var json = self.json;
    		var t='';
    		var vt='';
    		self.value = v;
    		if(undefined!=t){
    			textObj.value = t;
    		}
    		if(undefined!=v){
    			valueObj.value = v;
    		}
    		if(undefined!=self.findsql){
    			self.AjaxList();//重新加载选项
    		}
    		if(json.length>0){
    			for(var i=0;i<json.length;i++){
    	            if(json[i].value==v){
    	            	t = json[i].text;//给显示值
    	            	vt = json[i].vtype;
    	            	var nod = {value:v,text:t};
    	            	json[i].id = self.id;
    	            	json[i].name = self.name;
    	    			if(self.onchange(json[i])){
    			    		valueObj.value = v;//附值
    			    		textObj.value = t;//显示值
    			            try{$(self.id+'_img').hide();}catch(e){}
    			           //---------------------设置级联动作-----------------------------------
    			            if(self.lower!=undefined && self.lower!='' && vt!=undefined){
    			            	$(self.lower).clearShowValue();
    			            	var pares = (undefined == self.topLower?[]:self.topLower).clone();
    			            	pares[pares.length]={pare:valueObj.value,ftype:vt};
    		    				$(self.lower).AjaxLoadData(pares);
    		    			}
    	    			}
    	            	break;
    	            }
    	        }
    		}
    	};
    	//----------设置json----------------------
    	$(self.id).setJson = function(json){
    		self.clearShowValue();
    		self.json = json;
    		self.jsonList();
    	};
    	$(self.id).clearShowValue = function(){
    		if(undefined!=self.findsql){
    			$(self.cfg.id+'_fselect_body').innerHTML='';//清空显示值
    		}else{
    			$(self.cfg.id+'_sboddiv').innerHTML='';//清空显示值
    		}
    		self.clearShowValue();
    		if(self.lower!=undefined && self.lower!=''){
    			$(self.lower).clearShowValue();
    		}
    	};
    	//----------设置sql及参数-------------------
    	$(self.id).AjaxLoadData = function(pare){//[{pare:'',ftype:''},{}]
        	self.topLower = pare.clone();
    		self.AjaxListSQL(pare);
    	};
    	//----------------------------------
    	$(self.id).setDisabled = function(a){
    		$(self.id+'_sinput').writeAttribute({disabled:a});
    		self.disabled=a;
    	};
    	$(self.id).setReadonly = function(a){
    		$(self.id+'_sinput').writeAttribute({readonly:a});
    		self.readonly=a;
    	};
    },
    //--------------------重设查找区域高度-------------------------------------------------------
    setHeigthFindBody : function(){
    	var self = this;
    	if(undefined!=self.findsql){
    		try{
    			var findHeight = $(self.id+'_findinput').getHeight();//查找输入框的高度
    			var xheight = self.nowHeight + findHeight+2;
    			$(self.id+'_sboddiv').setStyle({height:xheight+'px'});
    			$(self.id+'_fselect_body').setStyle({height:self.nowHeight+'px'});
    		}catch(e){}
    	}
    },
    setFindInputFous : function(){
    	var self = this;
    	try{
			$(self.id+'_findInputtext').focus();
		}catch(e){}
    },
    //===================下拉框事件============================================================
    selectEvent : function(obj,tre){
    	var self = this;
        var miFlg = true;
    	obj.observe('click',function(a){
    		if(self.readonly || self.disabled){
    			return;
    		}
    		var atop = obj.positionedOffset().top+obj.offsetHeight;
    		var aleft = obj.positionedOffset().left;
        	tre.absolutize();
        	tre.style.top=atop;
        	tre.style.left=aleft;
        	tre.setStyle({left:aleft+'px',top:atop+'px'});
        	tre.show();
        	self.setHeigthFindBody();
        	self.setFindInputFous();
        	try{
        		if(undefined!=self.findsql){
        			$(self.id+'_findInputtext').value='';
        			self.findValue='';
        			self.FindAjaxList();
        		}
        	}catch(e){}
        });
        obj.observe('mousemove',function(){
    		miFlg = true;
    		self.setSelectStyle(obj);
    	});
        
        obj.observe('mouseout',function(event){
        	miFlg = false;
        	var element = event.element();
        	setTimeout(function(){
                if (element.descendantOf(self.sdy) && !miFlg){
                	self.setNoSelectStyle(obj);
                	tre.hide();
                }
            }, 500);
        });
        
        tre.observe('mousemove',function(){
    		miFlg = true;
    		self.setSelectStyle(obj);
    	});
        tre.observe('mouseout',function(event){
        	miFlg = false;
        	var element = event.element();
        	setTimeout(function(){
                if (element.descendantOf(self.sdy) && !miFlg){
                	self.setNoSelectStyle(obj);
                	tre.hide();
                }
            }, 500);
        });
        document.observe('widget:noka_reinit',function(event){//失失焦点时验证其值
   		if(self.id.indexOf('_nkADinsert_')==-1){
	    		var npfffs=event.memo.widgetNumber.clone();
	    		for(var i=0;i<npfffs.length;i++){
	    			var cfgid = Object.allclone(self.cfg);
	    			var initem = npfffs[i];
	    			cfgid.id = initem.id;
	    			if(cfgid.id.indexOf('_'+self.id+'_')!=-1){
	    				if(undefined !=cfgid.lower && cfgid.lower.trim().length>0){
	    					var reg=new RegExp('_'+self.id+'_','g');
	    					var ssf = cfgid.id.split(reg);
	    					cfgid.lower = ssf[0]+'_'+cfgid.lower+'_'+ssf[1];
	    				}
	    				(new nselect(cfgid)).show();
	    				try{
	    					var idx = cfgid.id.substring(cfgid.id.lastIndexOf('_')+1,cfgid.id.length);
	    					$(cfgid.id).name=$(cfgid.id).name.replace(/\[0\]/g,'['+idx+']');
	    					if(undefined!=initem.value && $(cfgid.id).name==initem.name){
	    						$(cfgid.id).setValue(initem.value);
	    					}
	    				}catch(e){}
	    			}
	    		}
   		 }
   	 });
    },
   //----------选种状态-----------------------
    setSelectStyle : function(obj){
    	var self = this;
    	obj.setStyle({borderColor:'#5794bf',backgroundImage:'url('+self.hImg.src+')'});
    },
    //-----------未选种状态-------------------
    setNoSelectStyle : function(obj){
    	var self = this;
    	obj.setStyle({borderColor:'#AFAFAF',backgroundImage:'url('+self.mImg.src+')'});
    },
    //-----------预加载图片-------------------
    PreLoding : function(){
    	var self = this;
    	self.hImg = new Image(); 
    	self.mImg = new Image();
    	self.hImg.src=self.cfg.rurl+'/nokatag/org/noka/select/dropdown_hover.png';
    	self.mImg.src=self.cfg.rurl+'/nokatag/org/noka/select/dropdown.png';
    	NBackgroundImageCache();
    }
});